#include <iostream>
#include <algorithm>

int main()
{
	int n, s;
	int t = -1;
	std::cin >> n >> s;
	while (n--) {
		int x, y;
		std::cin >> x >> y;
		if (s * 100 >= x * 100 + y)
			t = std::max(t, (100 - y) % 100);
	}
	std::cout << t << '\n';
}

